<template>
  <section class="index">
    <div class="hello" v-if="this.user.role">
      <i class="iconfont icon-xihuan" ></i><span>很高兴遇见你,{{user.userName}}同学。</span>
    </div>
    <div class="hello" v-else>
      <i class="iconfont icon-xihuan" ></i><span>很高兴遇见你,{{user.userName}}老师。</span>
    </div>
    <el-calendar v-model="value">
</el-calendar>

  </section>
</template>

<script>
export default {
  data() {
    return {
      user: { //用户信息
        userName: null,
        role:null
      } ,
      value: new Date()
    }
  },
  created() {
    this.getUserInfo()
  },
  methods: {
    getUserInfo() { //获取用户信息
      this.user.userName = this.$cookies.get('username')
      this.user.role = this.$store.state.roles
    },
  }
}
</script>


<style lang="less" scoped>
.index {
  margin-left: 70px;
  .hello {
    font-size: 20px;
    color: #726f70;
    .icon-xihuan {
      font-size: 30px;
      color: #dd6572;
    }
  }
  .msg {
    .title {
      font-size: 16px;
      color: #000;
      margin-top: 20px;
      margin-left: 10px;
    }
    ul {
      display: flex;
      flex-direction: column;
      width: 200px;
      overflow: hidden;
    }
    li {
      margin-top: 10px;
      font-size: 14px;
      color: lightcoral;
      cursor: pointer;
      display: inline-block;
    }
  }
}
</style>

